
<?php

require 'config_inc.php';
require 'dal_common.php';
require 'dal_session.php';
require 'dal_mocool.php';
require 'dal_achievement.php';
require 'api_common.php';

$t_args = get_params(Array(
	'token' => '+token',
	'game' => '+game'
));
if ($t_args == null) {
	echo 'ERROR=INVALID_PARAMETER;';
	return;
}

$t_userid = dal_session_get($t_args['token']);
if ($t_userid < 0) {
	echo 'ERROR=INVALID_TOKEN;';
	return;
}

$t_result = dal_achievement_get($t_userid, $t_args['game']);
if ($t_result == null) {
	echo 'ERROR=0;{}';
} else {
	echo 'ERROR=0;' . json_encode($t_result);
}

?>
